
import 'package:fluent_ui/fluent_ui.dart';

import '../../../../extension/extension_widget.dart';
import '../../../widgets/gyy_theme.dart';
import '../../../widgets/page.dart';
import '../../../widgets/paper/menu_layout.dart';

class EditPaperPage extends ScrollablePage {
  EditPaperPage({super.key});

  static const double space5 = 5;
  List<String> buttonList = [
    '11',
    '222',
    '333',
    '44',
    '55',
    '66',
    '44',
    '55',
    '66'
  ];
  bool checked4 = false;

  TextEditingController defaultController = TextEditingController();
  TextEditingController customerController = TextEditingController();
  TextEditingController dateController = TextEditingController();
  TextEditingController phoneController = TextEditingController();

  @override
  Widget buildHeader(BuildContext context) {
    return const PageHeader(title: Text('西班牙唐人街广告科技公司'));
  }

  @override
  List<Widget> buildScrollable(BuildContext context) {
    return [
      const Text(
        '电话：15238373837，邮编：200200，\n\n'
        '地址：西班牙唐人街1号',
      ),
      sizeBoxV5,
      Row(
        children: [
          Expanded(
              flex: 7, child: GyyTextInput('客户/店面 名称：', customerController)),
          sizeBoxH5,
          Expanded(flex: 3, child: GyyTextInput('开单日期：', dateController))
        ],
      ),
      sizeBoxV5,
      GyyTextInput('微信/电话 信息：', phoneController),
      sizeBoxV5,
      Row(
        children: [
          SizedBox(
            child: Container(
              color: Colors.red.dark,
            ),
            width: 30,
            height: 30,
          ),
          Text('平面广告系列：',
              style: TextStyle(
                  color: Colors.red.dark,
                  fontSize: 25,
                  fontWeight: FontWeight.bold)),
          Text('请提供完整的数据资料，在设计师排版完成后务必认真核对!\n印刷产品仅对印后产品质量负责，内容错误不在质量范围内!',
              style: TextStyle(fontSize: 11, fontWeight: FontWeight.bold)),
          spacer,
          SizedBox(
            child: GyyTextInput('客户同意签字：', dateController),
            width: 180,
          ),
        ],
      ),
      sizeBoxV10,
      Container(
        color: Colors.grey.withOpacity(0.3),
        child: Column(
          children: [
            //第一行，菜单
            Row(
              children: [
                OutlinedButton(
                    style: ButtonStyle(
                        backgroundColor: ButtonState.all(Colors.white),
                        border: ButtonState.all(
                            BorderSide(color: Colors.red.dark, width: 2))),
                    child: Container(
                      width: 60,
                      child: Text('菜单',
                          style: TextStyle(
                              color: Colors.purple.dark,
                              fontSize: 20,
                              fontWeight: FontWeight.bold)),
                    ),
                    onPressed: null),
                SizedBox(width: 40,),
                //备注
                GyyTextBoxHint('过敏原', 100,  35, defaultController),
                sizeBoxH1,
                GyyTextBoxHint('排版费', 100,  35, defaultController),
                GyyTextBoxHint('数量', 100,  35, defaultController),
                sizeBoxH1,
                GyyTextBoxHint('印刷费', 100,  35, defaultController),

                spacer,

                Column(
                  children: [
                    Text('费用小计', style: TextStyle(fontSize: 10),),
                    SizedBox(
                      width: 90,
                      height: 20,
                      child: GyyTextBox(
                        placeholder: '',
                      ),
                    ),
                  ],
                ),
                Column(
                  children: [
                    Text('折扣', style: TextStyle(fontSize: 10),),
                    SizedBox(
                      width: 90,
                      height: 20,
                      child: GyyTextBox(
                        placeholder: '',
                      ),
                    ),
                  ],
                ),
                Column(
                  children: [
                    Text('价格合计', style: TextStyle(fontSize: 10),),
                    SizedBox(
                      width: 90,
                      height: 20,
                      child: GyyTextBox(
                        placeholder: '',
                      ),
                    ),
                  ],
                ),

              ],
            ),
            sizeBoxV5,
            //第二行，基础款
            Row(
              children: [
                sizeBoxH10,
                Container(
                  width: 80,
                  child:  Column(
                    children: [
                      Text('基础款').padding(EdgeInsets.all(5)),
                      Text('常用款').padding(EdgeInsets.all(5)),
                      Text('高端款').padding(EdgeInsets.all(5)),
                    ],
                  ),
                ),
                //款式gridView
                MenuLayout(),
                //备注
                SizedBox(
                  child:  Column(
                    children: [
                      Container(
                          decoration: boxDecoration,
                          child: const TextBox(
                            maxLines: null,
                            expands: true,
                            highlightColor: Colors.transparent,
                            unfocusedColor: Colors.transparent,
                            placeholder: '备注',
                            minHeight: 84,
                          )
                      ),
                    ],
                  ),
                  width: 180,
                  height: 90,
                ),

              ],
            ),
            //第3行，二维码
            Row(
              children: [
                sizeBoxH10,
                Container(
                  width: 80,
                  child:  Column(
                    children: [
                      Text('二维码').padding(EdgeInsets.all(5)),
                    ],
                  ),
                ),

                Expanded(child:  GyyToggleButton(
                  '特殊材料',
                  checked4,
                      (v) {
                    checked4 = v;
                    setState(() {});
                  },
                ),),
              ],
            )
          ],
        ),
      ),
      sizeBoxV5,
      // Container(
      //   child: m.TextField(
      //       keyboardType: TextInputType.emailAddress,
      //       decoration: m.InputDecoration(
      //           labelText: "Email",
      //           hintText: "电子邮件地址",
      //           border: m.InputBorder.none //隐藏下划线
      //       )
      //   ),
      //   decoration: BoxDecoration(
      //     // 下滑线浅灰色，宽度1像素
      //       border: Border(bottom: BorderSide(color: Colors.grey[200], width: 1.0))
      //   ),
      // )
      // FilledButton(child: Text('保存'), onPressed: () async{
      //   debugPrint('-----' + nameController.text);
      // }),
    ];
  }
}
